home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Complete Utilities To…ka 501 Killer Utilities!
/
501 Killer Utilities! (Macworld July 1995).cdr
/
Programming
/
RLaB
/
examples
/
conv.r
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Text File
|
1994-03-27
|
314 b
|
20 lines
|
[
TEXT/RLAB
]
#
# Simplistic convolution function.
# x and y must be vectors...
# No error checking.
#
conv = function( x , y )
{
local( X , Y , n, tmp );
n = x.n + y.n - 1;
X = fft( x, n );
Y = fft( y, n );
tmp = ifft( X .* Y );
if( type(x) == "real" && type(y) == "real") { tmp = real(tmp); }
return tmp;
};